﻿using FlowCanvas.Nodes;
using Yoozoo.Gta.Common;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    public class SwitchInHangingLevelScene : FlowControlNode
    {
        protected override void RegisterPorts()
        {
            var caseTrue = AddFlowOutput("True");
            var caseFalse = AddFlowOutput("False");
            var caseThen = AddFlowOutput("Then");
            AddFlowInput("In", (f) =>
            {
                bool passed = ResidentHandler.Inst.GetFunction("CityLuaFunction.isInHangingPveLevelScene").Func<int, bool>(0);;
                if (passed)
                {
                    f.Call(caseTrue);
                }
                else
                {
                    f.Call(caseFalse);
                }
                
                f.Call(caseThen);
            });

        }
    }
}